﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MMMaze
{
    public class TestRoomMatrix3DInt : IRoomMatrix3DFactory<String>
    {
        #region IRoomMatrix3DFactory<String> Members

        public RoomMatrix3D<String> CreateRoomMatrix3D()
        {

            var tarea = new Area3D<String>();
            tarea.SetWallContent(Axises3D.X, AxisDirection.Positive, "E");
            tarea.SetWallContent(Axises3D.X, AxisDirection.Negtive , "W");
            tarea.SetWallContent(Axises3D.Y, AxisDirection.Positive, "S");
            tarea.SetWallContent(Axises3D.Y, AxisDirection.Negtive, "N");

            
            var tmpval = new RoomMatrix3D<String>(tarea);
            Area3D<String> etemp = tarea;
            Area3D<String> wtemp = tarea;

            for (var j = 1; j <= 10; j++)
            {
                var Earea = new Area3D<String>();
                Earea.SetWallContent(Axises3D.X, AxisDirection.Positive, "E;" + j.ToString());
                Earea.SetWallContent(Axises3D.X, AxisDirection.Negtive, "W;" + j.ToString());
                Earea.SetWallContent(Axises3D.Y, AxisDirection.Positive, "S;" + j.ToString());
                Earea.SetWallContent(Axises3D.Y, AxisDirection.Negtive, "N;" + j.ToString());
                tmpval.AddRoom(Earea, etemp, Axises3D.X, AxisDirection.Positive);
                etemp = Earea;

                var Warea = new Area3D<String>();
                Warea.SetWallContent(Axises3D.X, AxisDirection.Positive, "E;" + j.ToString());
                Warea.SetWallContent(Axises3D.X, AxisDirection.Negtive, "W;" + j.ToString());
                Warea.SetWallContent(Axises3D.Y, AxisDirection.Positive, "S;" + j.ToString());
                Warea.SetWallContent(Axises3D.Y, AxisDirection.Negtive, "N;" + j.ToString());


                tmpval.AddRoom(Warea, wtemp, Axises3D.X, AxisDirection.Negtive);
                wtemp = Warea;
            }



            Area3D<String> ntemp =tarea ;
            Area3D<String> stemp =tarea  ;
            for (var i = 1; i <=10; i++)
            {
                var Narea = new Area3D<String>();
                Narea.SetWallContent(Axises3D.X, AxisDirection.Positive, "E;" +  i.ToString ());
                Narea.SetWallContent(Axises3D.X, AxisDirection.Negtive, "W;" +   i.ToString ());
                Narea.SetWallContent(Axises3D.Y, AxisDirection.Positive, "S;" +   i.ToString ());
                Narea.SetWallContent(Axises3D.Y, AxisDirection.Negtive, "N;" +   i.ToString ());
                tmpval.AddRoom(Narea, ntemp, Axises3D.Y, AxisDirection.Negtive);
                ntemp = Narea;

                var Sarea = new Area3D<String>();
                Sarea.SetWallContent(Axises3D.X, AxisDirection.Positive, "E;-" +  i.ToString ());
                Sarea.SetWallContent(Axises3D.X, AxisDirection.Negtive, "W;-" +  i.ToString ());
                Sarea.SetWallContent(Axises3D.Y, AxisDirection.Positive, "S;-" +  i.ToString ());
                Sarea.SetWallContent(Axises3D.Y, AxisDirection.Negtive, "N;-" +  i.ToString ());
                tmpval.AddRoom(Sarea, stemp, Axises3D.Y, AxisDirection.Positive);
                stemp = Sarea;



              etemp = Narea;
              wtemp = Narea;

                for (var j = 1; j <= 10; j++)
                {
                    var Earea = new Area3D<String>();
                    Earea.SetWallContent(Axises3D.X, AxisDirection.Positive, "E;" + j.ToString());
                    Earea.SetWallContent(Axises3D.X, AxisDirection.Negtive, "W;" + j.ToString());
                    Earea.SetWallContent(Axises3D.Y, AxisDirection.Positive, "S;" + j.ToString());
                    Earea.SetWallContent(Axises3D.Y, AxisDirection.Negtive, "N;" + j.ToString());
                    tmpval.AddRoom(Earea, etemp, Axises3D.X, AxisDirection.Positive);
                    etemp = Earea;

                    var Warea = new Area3D<String>();
                    Warea.SetWallContent(Axises3D.X, AxisDirection.Positive, "E;" + j.ToString());
                    Warea.SetWallContent(Axises3D.X, AxisDirection.Negtive, "W;" + j.ToString());
                    Warea.SetWallContent(Axises3D.Y, AxisDirection.Positive, "S;" + j.ToString());
                    Warea.SetWallContent(Axises3D.Y, AxisDirection.Negtive, "N;" + j.ToString());


                    tmpval.AddRoom(Warea, wtemp, Axises3D.X, AxisDirection.Negtive);
                    wtemp = Warea;
                }


                etemp = Sarea;
                wtemp = Sarea;

                for (var j = 1; j <= 10; j++)
                {
                    var Earea = new Area3D<String>();
                    Earea.SetWallContent(Axises3D.X, AxisDirection.Positive, "E;" + j.ToString());
                    Earea.SetWallContent(Axises3D.X, AxisDirection.Negtive, "W;" + j.ToString());
                    Earea.SetWallContent(Axises3D.Y, AxisDirection.Positive, "S;" + j.ToString());
                    Earea.SetWallContent(Axises3D.Y, AxisDirection.Negtive, "N;" + j.ToString());
                    tmpval.AddRoom(Earea, etemp, Axises3D.X, AxisDirection.Positive);
                    etemp = Earea;

                    var Warea = new Area3D<String>();
                    Warea.SetWallContent(Axises3D.X, AxisDirection.Positive, "E;" + j.ToString());
                    Warea.SetWallContent(Axises3D.X, AxisDirection.Negtive, "W;" + j.ToString());
                    Warea.SetWallContent(Axises3D.Y, AxisDirection.Positive, "S;" + j.ToString());
                    Warea.SetWallContent(Axises3D.Y, AxisDirection.Negtive, "N;" + j.ToString());


                    tmpval.AddRoom(Warea, wtemp, Axises3D.X, AxisDirection.Negtive);
                    wtemp = Warea;
                }

            }

      



            return tmpval;
        }

        #endregion
    }
}
